define(function () {
    'use strict';
    function ctrl($scope, $state, $stateParams, $ionicLoading, $ionicPopup, LocalCacheService, CommonService, FinancingService) {

        function init() {
            $scope.financing = {};
            //判断易通是否已经开通。如果已开通则直接跳转页面
            //$state.go('tab.account-easyFinancingHome');
            //如果未开通则显示开通页面
            $scope.financing = {
                status: 0
            };
            //如果在开通申请中
            //$scope.financing.status = 1;
            //如果开通失败
            //$scope.financing.status = 0;
            //$ionicPopup.show({
            //    cssClass: "kDialog",
            //    template: "开通失败，请重新开通。",
            //    buttons: [
            //        {text: '我知道了'}
            //    ]
            //});
        }

        $scope.$on('$ionicView.beforeEnter', function () {
            init();
        });
    }

    ctrl.$inject = ['$scope', '$state', '$stateParams', '$ionicLoading', '$ionicPopup', 'LocalCacheService', 'CommonService', 'FinancingService'];
    return ctrl;
});